package com.pjj.base.base.utils;

//import lombok.Data;
//
//import javax.annotation.sql.DataSourceDefinition;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 76004
 * @apiNote
 * @date 2023/2/27 20:07
 */
@Data
public class ResponseUtil {

    public static Map<String,Object> success(Object data){
        Map<String,Object>map = new HashMap<>();
        map.put("code",100);
        map.put("msg","操作成功");
        map.put("data",data);
        return map;
    }

    public static Map<String,Object> success(){
        Map<String,Object>map = new HashMap<>();
        map.put("code",100);
        map.put("msg","操作成功");
        return map;
    }

    public static Map<String,Object>fail(String msg){
        Map<String,Object>map = new HashMap<>();
        map.put("code",200);
        map.put("msg",msg);
        return map;
    }

    public static Map<String,Object>fail(){
        Map<String,Object>map = new HashMap<>();
        map.put("code",200);
        map.put("msg","操作失败");
        return map;
    }


}
